home *** CD-ROM | disk | FTP | other *** search
/ Delphi Developer's Kit 1996 / Delphi Developer's Kit 1996.iso / power / regmax.000 / regform.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-12-22  |  7.3 KB  |  230 lines

  1. VERSION 2.00
  2. Begin Form REGFORM 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Registration Form"
  6.    ClientHeight    =   2490
  7.    ClientLeft      =   1770
  8.    ClientTop       =   3375
  9.    ClientWidth     =   6780
  10.    FontBold        =   0   'False
  11.    FontItalic      =   0   'False
  12.    FontName        =   "MS Sans Serif"
  13.    FontSize        =   8.25
  14.    FontStrikethru  =   0   'False
  15.    FontUnderline   =   0   'False
  16.    Height          =   3045
  17.    Icon            =   REGFORM.FRX:0000
  18.    Left            =   1635
  19.    LinkTopic       =   "Form1"
  20.    MaxButton       =   0   'False
  21.    MinButton       =   0   'False
  22.    ScaleHeight     =   2490
  23.    ScaleWidth      =   6780
  24.    Top             =   2955
  25.    Width           =   7050
  26.    Begin TextBox txt_USERORG 
  27.       FontBold        =   -1  'True
  28.       FontItalic      =   0   'False
  29.       FontName        =   "Arial"
  30.       FontSize        =   9.75
  31.       FontStrikethru  =   0   'False
  32.       FontUnderline   =   0   'False
  33.       Height          =   360
  34.       Left            =   1140
  35.       TabIndex        =   2
  36.       TabStop         =   0   'False
  37.       Text            =   "Text1"
  38.       Top             =   1980
  39.       Width           =   3975
  40.    End
  41.    Begin TextBox txt_USERNAME 
  42.       FontBold        =   -1  'True
  43.       FontItalic      =   0   'False
  44.       FontName        =   "Arial"
  45.       FontSize        =   9.75
  46.       FontStrikethru  =   0   'False
  47.       FontUnderline   =   0   'False
  48.       Height          =   360
  49.       Left            =   1140
  50.       TabIndex        =   0
  51.       TabStop         =   0   'False
  52.       Text            =   "Text1"
  53.       Top             =   1500
  54.       Width           =   3975
  55.    End
  56.    Begin CommandButton btn_Cancel 
  57.       Cancel          =   -1  'True
  58.       Caption         =   "&Cancel"
  59.       Height          =   495
  60.       Left            =   5340
  61.       TabIndex        =   3
  62.       TabStop         =   0   'False
  63.       Top             =   840
  64.       Width           =   1215
  65.    End
  66.    Begin CommandButton btn_OK 
  67.       Caption         =   "&OK"
  68.       Height          =   495
  69.       Left            =   5340
  70.       TabIndex        =   1
  71.       TabStop         =   0   'False
  72.       Top             =   180
  73.       Width           =   1215
  74.    End
  75.    Begin Label Label1 
  76.       Alignment       =   1  'Right Justify
  77.       BackStyle       =   0  'Transparent
  78.       Caption         =   "Organisation:"
  79.       FontBold        =   0   'False
  80.       FontItalic      =   0   'False
  81.       FontName        =   "Arial"
  82.       FontSize        =   8.25
  83.       FontStrikethru  =   0   'False
  84.       FontUnderline   =   0   'False
  85.       Height          =   255
  86.       Left            =   60
  87.       TabIndex        =   6
  88.       Top             =   2040
  89.       Width           =   1035
  90.    End
  91.    Begin Label lbl_Name 
  92.       Alignment       =   1  'Right Justify
  93.       BackStyle       =   0  'Transparent
  94.       Caption         =   "Your Name:"
  95.       FontBold        =   0   'False
  96.       FontItalic      =   0   'False
  97.       FontName        =   "Arial"
  98.       FontSize        =   8.25
  99.       FontStrikethru  =   0   'False
  100.       FontUnderline   =   0   'False
  101.       Height          =   255
  102.       Left            =   60
  103.       TabIndex        =   5
  104.       Top             =   1560
  105.       Width           =   1035
  106.    End
  107.    Begin Label lbl_Title1 
  108.       Alignment       =   2  'Center
  109.       BackStyle       =   0  'Transparent
  110.       FontBold        =   -1  'True
  111.       FontItalic      =   0   'False
  112.       FontName        =   "Arial"
  113.       FontSize        =   10.5
  114.       FontStrikethru  =   0   'False
  115.       FontUnderline   =   0   'False
  116.       Height          =   1155
  117.       Left            =   180
  118.       TabIndex        =   4
  119.       Top             =   180
  120.       Width           =   4935
  121.    End
  122.    Begin Image img_Icon 
  123.       BorderStyle     =   1  'Fixed Single
  124.       Height          =   510
  125.       Left            =   5700
  126.       Picture         =   REGFORM.FRX:0302
  127.       Top             =   1620
  128.       Width           =   510
  129.    End
  130. Option Explicit
  131. '   //General variable//
  132. Dim msg As String
  133. Sub btn_Cancel_Click ()
  134. '   /* Modified 31/12/94 [GB] */
  135. '   /* Created 31/12/94 [GB] */
  136. USERNAME = "UNLICENSED"
  137. USERORG = "UNLICENSED"
  138. Unload Me
  139. End Sub
  140. Sub btn_OK_Click ()
  141. '   /* Modified 14/01/95 [GB] */
  142. '   /* Modified 31/12/94 [GB] */
  143. '   /* Created 31/12/94 [GB] */
  144. USERNAME = UCase$(txt_USERNAME.Text)
  145. USERORG = UCase$(txt_USERORG.Text)
  146. Dim sz_Key As String
  147. Dim i_RetVal As Integer
  148. If ISVBRUNNING() = 0 Then
  149.     If EXE = True Then
  150.     sz_Key = InputBox$("Please enter your unique registration code", "REGMAX Registration", "1234567890")
  151.     i_RetVal = PutDataIntoEXE(USERNAME, USERORG, sz_Key)
  152.     End If
  153.     If INI = True Then
  154.     i_RetVal = PutDataIntoINI(USERNAME, USERORG)
  155.     End If
  156. End If
  157. '   //Failed Write//
  158. If (EXE = True) And (i_RetVal > 16) Then
  159.     MsgBox "Unable to Write to this file.", 0, "REGMAX"
  160.     EnableWrites
  161. End If
  162. Unload Me
  163. End Sub
  164. Sub EnableWrites ()
  165. '   /* Modified 15/01/95 [GB] */
  166. '   /* Created 15/01/95 [GB] */
  167. MainForm!btn_WriteINIData.Enabled = True
  168. MainForm!btn_WriteRegData.Enabled = True
  169. MainForm!btn_WriteBoth.Enabled = True
  170. MainForm!btn_Write_Ext_EXE.Enabled = True
  171. MainForm!Btn_Write_Ext_INI.Enabled = True
  172. MainForm!btn_Write_Ext_EXEINI.Enabled = True
  173. MainForm!Fra_Info(0).Caption = "Wri&te Information"
  174. MainForm!Fra_Info(2).Caption = "Wr&ite to External EXE"
  175. End Sub
  176. Sub Form_Load ()
  177. '   /* Modified 31/12/94 [GB] */
  178. '   /* Created 31/12/94 [GB] */
  179. On Error GoTo LOADOUT
  180. '   //Place the form correctly on the screen//
  181. Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
  182. '   //Initialise this form display//
  183. InitFrmVars
  184. '   //Form must be visible for SetFocus to work//
  185. txt_USERNAME.SelStart = 0
  186. txt_USERNAME.SelLength = Len(txt_USERNAME.Text)
  187. txt_USERNAME.SetFocus
  188. LOADOUT:
  189. Exit Sub
  190. End Sub
  191. Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
  192. '   /* Modified 31/12/94 [GB] */
  193. '   /* Created 31/12/94 [GB] */
  194. MainForm.Show
  195. End Sub
  196. Sub InitFrmVars ()
  197. '   /* Modified 31/12/94 [GB] */
  198. '   /* Created 31/12/94 [GB] */
  199. msg = "Thank you for purchasing this software.  "
  200. msg = msg & "In order to complete the registration details, please type in the following information,"
  201. msg = msg & " and then select OK."
  202. lbl_Title1.Caption = msg
  203. '   //Initialise for Text Boxes//
  204. USERNAME = "Gordon Bamber"
  205. USERORG = "gbamber@mistral.co.uk"
  206. txt_USERNAME.Text = USERNAME
  207. txt_USERORG.Text = USERORG
  208. If EXE Then MsgBox "Unless you have a personal code key, then please accept the default values.", 48, ">> REGMAX Demonstration <<"
  209. End Sub
  210. Sub txt_USERNAME_KeyDown (KeyCode As Integer, Shift As Integer)
  211. '   /* Modified 31/12/94 [GB] */
  212. '   /* Created 31/12/94 [GB] */
  213. If KeyCode = 13 Or KeyCode = 9 Then
  214.     KeyCode = 0
  215.     USERNAME = txt_USERNAME.Text
  216.     txt_USERORG.SelStart = 0
  217.     txt_USERORG.SelLength = Len(txt_USERORG.Text)
  218.     txt_USERORG.SetFocus
  219. End If
  220. End Sub
  221. Sub txt_USERORG_KeyDown (KeyCode As Integer, Shift As Integer)
  222. '   /* Modified 31/12/94 [GB] */
  223. '   /* Created 31/12/94 [GB] */
  224. If KeyCode = 13 Or KeyCode = 9 Then
  225.     KeyCode = 0
  226.     USERORG = txt_USERORG.Text
  227.     Btn_OK.SetFocus
  228. End If
  229. End Sub
  230.